<?php
/**
 * This file is part of Swoft.
 *
 * @link https://swoft.org
 * @document https://doc.swoft.org
 * @contact group@swoft.org
 * @license https://github.com/swoft-cloud/swoft/blob/master/LICENSE
 */

namespace App\Controllers;

use Swoft\Http\Server\Bean\Annotation\Controller;
use Swoft\Http\Server\Bean\Annotation\RequestMapping;
use Swoft\Http\Server\Bean\Annotation\RequestMethod;
use Swoft\View\Bean\Annotation\View;
// use Swoft\Http\Message\Server\Response;

/**
 * Class LiveController
 * @Controller(prefix="/live")
 * @package App\Controllers
 */
class LiveController{
    /**
     * this is a example action. access uri path: /live
     * @RequestMapping(route="/live", method=RequestMethod::GET)
     * @return array
     */
    public function index(): array
    {
        return ['item0', 'item1'];
    }
    /**
     * 视图渲染demo - 没有使用布局文件
     * @RequestMapping()
     * @View(template="live/index")
     */
    public function view()
    {
        $data = [
            'name'   => 'Swoft',
            'repo'   => 'https://github.com/swoft-cloud/swoft',
            'doc'    => 'https://doc.swoft.org/',
            'doc1'   => 'https://swoft-cloud.github.io/swoft-doc/',
            'method' => __METHOD__,
        ];

        return $data;
    }
}
